<?php
$v_fuseaction_back = $_REQUEST['fuseaction'];
// Luu ten style hien thoi
$v_current_style_name = "odd_row";
$v_next_style_name = "round_row";
$v_url_send_question = "index.php?fuseaction=DISPLAY_SINGLE_QA_QUESTION_FOR_SENDING&fuseaction_back=".$v_fuseaction_back;
?>
<!--bang chua tieu de cua form-->
<form action="index.php" method="post" name="f_qa_by_all_cate">
<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="page_title">
		<td><?php echo CONST_QA_LIST_ALL_CATE_TITLE; ?></td>
	</tr>
	<tr> 
		<td class="send_qa_link" >
			<a href="<?php echo $v_url_send_question;?>"><?php echo CONST_QA_QUESTION_FOR_ANSWER_TITLE;?></a>
			<img src="<?php echo $_ISA_IMAGE_URL_PATH?>send_qa.gif">
		</td>
	</tr>	
</table>
<table width="100%" cellpadding="0" cellspacing="0"><?php
	if ($v_count >0){
		$row_index = 0;
		$v_old_cate_id = 0;
		while($row_index < $v_count){
			$v_cate_id = $arr_all_qa_by_all_cate[$row_index]['PK_CATE'];
			$v_qa_id = $arr_all_qa_by_all_cate[$row_index]['PK_QA'];
			$v_cate_name = $arr_all_qa_by_all_cate[$row_index]['C_NAME'];
			$v_qa_questioner_name = $arr_all_qa_by_all_cate[$row_index]['C_QUESTIONER_NAME'];
			$v_qa_question_title = $arr_all_qa_by_all_cate[$row_index]['C_QUESTION_TITLE'];
			$v_question_date = _yyyymmdd_to_ddmmyyyy($arr_all_qa_by_all_cate[$row_index]['C_QUESTION_DATE']);
			$v_answer_date = $arr_all_qa_by_all_cate[$row_index]['C_ANSWER_DATE'];
			$v_number_qa_of_cate = $arr_all_qa_by_all_cate[$row_index]['C_NUM_QA'];
			
			$v_cate_url = "index.php?fuseaction=DISPLAY_ALL_QA_BY_CATE&hdn_cate_id=".$v_cate_id;
			$v_qa_url = "index.php?fuseaction=DISPLAY_SINGLE_QA_QUESTION&qa_id=".$v_qa_id;
			
			$v_str_questioner_information = "(";
			$v_str_questioner_information = $v_str_questioner_information.$v_qa_questioner_name;
			$v_str_questioner_information = $v_str_questioner_information.", h&#7887;i ng&#224;y : ".$v_question_date.")";	
			
			if ($v_current_style_name == "odd_row"){
				$v_current_style_name = "round_row";
			}else{
				$v_current_style_name = "odd_row";
			}
			if($v_old_cate_id!=$v_cate_id){ ?>	
				<tr><td height="5pt"></td></tr>
				<tr class="agency_link"> 
					<td align="left">
						<a href="<?php echo $v_cate_url; ?>" class="agency_link"><?php echo $v_cate_name; ?>&nbsp;</a><small class="number_label"><?php echo "(&nbsp;".$v_number_qa_of_cate."&nbsp;)";?></small>
					</td>
				</tr><?php
			}?>
			<tr class="cate_on_list_page">
				<td align="left">
					<img src="<?php echo $_ISA_IMAGE_URL_PATH?>nut_before_article.gif" >
					<a class="cate_on_list_page" href="<?php echo $v_qa_url; ?>"><?php echo $v_qa_question_title; ?>&nbsp;</a><small class="number_label"><?php echo $v_str_questioner_information;?></small>
				</td>
			</tr><?php 
			$v_old_cate_id = $v_cate_id;
			$row_index++ ;  
		}	
	}else{ ?>
		<tr>
			<td class="normal_label"><?php echo CONST_QA_EMPTY_BY_CATE_LABEL;?></td>
		</tr><?php
	}?>
</table>
</form>
	
